package com.blank.shop.seata.business;

import com.blank.shop.seata.ShopAlibabaSeataApplication;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <br/>Date 2021/8/30
 * <br/>Time 16:16:45
 *
 * @author _blank
 */
@Profile({ShopAlibabaSeataApplication.PROFILE_BUSINESS})
@FeignClient(name = HomeController.SERVICE_URL_STORAGE)
public interface StorageService {

    /**
     * 库存扣减
     *
     * @param productId 产品id
     * @param count     数量
     * @return org.springframework.http.ResponseEntity
     */
    @PostMapping(path = {"storage-decrease"})
    ResponseEntity<String> decrease(@RequestParam Long productId, @RequestParam Integer count);

}
